/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package mscs.client.goods.view;

import java.util.Arrays;
import java.util.Vector;
import javax.swing.table.DefaultTableModel;

/**
 *
 * @author Usbuild
 */
public class TableModelFactory {
    public final static Vector<String> GOODS_COLUMN_NAMES = new Vector(Arrays.asList("编号", "数量", "描述", "销售价格", "生产日期", "报废日期", "入库日期", "成本价"));
    public final static Vector<String> ANALYSE_COLUMN_NAMES = new Vector(Arrays.asList("编号", "描述", "可存天数", "流通总量", "尺度天数", "每日流通", "预计天数", "预计报废率"));
    public final static Vector<String> OUTGOODS_COLUMN_NAMES = new Vector(Arrays.asList("编号", "描述", "数量", "出库原因"));
    public final static Vector<String> OPERATION_COLUMN_NAMES = new Vector(Arrays.asList("日期", "操作者ID"));
    public static DefaultTableModel getEnterGoodsModel() {
        return new MyTableModel(null, GOODS_COLUMN_NAMES);
    }
    public static DefaultTableModel getOutGoodsModel() {
        return new MyTableModel(null, OUTGOODS_COLUMN_NAMES);
    }
    public static DefaultTableModel getOperationTableModel() {
        return new MyTableModel(null, OPERATION_COLUMN_NAMES);
    }
    public static DefaultTableModel getAnalyseTableModel() {
        return new MyTableModel(null, ANALYSE_COLUMN_NAMES);
    }
    
}
class MyTableModel extends DefaultTableModel{
    public MyTableModel(Vector<Vector<String>> data, Vector<String> columnNames) {
        super(data, columnNames);
    }
    public boolean isCellEditable (int row, int column) {
        return false;
    }
}
